import re
pattern = r'[?|&]'                          #定义分隔符
url = 'http://local:8080/myweb/index.aspx?username="mr"&pwd="woshi"'
result = re.split(pattern,url)              #分割字符串
print(result)                               #输出匹配结果